// TOWN SCRIPT
//    Town 11: Werdna's Tower

// This is the special encounter script for this town.
// The states INIT_STATE, EXIT_STATE, and START_STATE have
// meanings that are described in the documenation. States you write
// yourself should be numbered from 10-100.

// flags:

begintownscript;

variables;

short i, x, y, choice;

body;

beginstate INIT_STATE;
	turn_off_training(1);

	if (get_flag(11, 0) == 0) {
		set_flag(11, 0, 1);
		reset_dialog();
		add_dialog_str(0, "It appears as if an army was let loose upon the tower.", 0);
		add_dialog_str(1, "Walls are cracked, some of the building is partially collapsed.", 0);
		add_dialog_str(2, "Seems as if Trebor thought Werdna would be stupid enough to go back home with the amulet.", 0);
		add_dialog_choice(0, "OK");
		choice = run_dialog(1);
	}
break;

beginstate EXIT_STATE;
// Always called when the town is left.
break;

beginstate START_STATE;
break;

beginstate 10;
	reset_dialog();
	add_dialog_str(0, "A brass plaque on the base of the statue reads:", 0);
	add_dialog_str(1, "Werdna, World's Greatest Arch-Mage and Wizard.", 0);
	add_dialog_str(2, "Someone apparently took offense at that judging from the statues damage.", 0);
	add_dialog_choice(0, "OK");
	choice = run_dialog(1);
break;

beginstate 11;
	message_dialog("The lever swings loosely in your hands.", "It was broken by whomever broke in to trash the place.");
break;

beginstate 12;
	message_dialog("The stairs up to the upper levels are blocked by the collapse of the roof", "Someone was really pissed to do all this damage.");
break;

beginstate 13;
	if (get_flag(11, 1) == 0) {
		set_flag(11, 1, 1);
		message_dialog("Whomever sacked the place picked through it very well.", "There probably isn't much left to find.");
	}
break;
